home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / MW MPW Binaries 1.1.1a2 / mwcPPC / MWCIncludes / Palettes.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-31  |  5.6 KB  |  158 lines  |  [TEXT/MMCC]

  1. /*
  2.     File:        Palettes.h
  3.  
  4.     Copyright:    © 1984-1993 by Apple Computer, Inc., all rights reserved.
  5.  
  6.     WARNING
  7.     This file was auto generated by the interfacer tool. Modifications
  8.     must be made to the master file.
  9.  
  10. */
  11.  
  12. #ifndef __PALETTES__
  13. #define __PALETTES__
  14.  
  15. #ifndef __QUICKDRAW__
  16. #include <Quickdraw.h>
  17. /*    #include <Types.h>                                            */
  18. /*        #include <ConditionalMacros.h>                            */
  19. /*        #include <MixedMode.h>                                    */
  20. /*            #include <Traps.h>                                    */
  21. /*    #include <QuickdrawText.h>                                    */
  22. /*        #include <IntlResources.h>                                */
  23. #endif
  24.  
  25. #ifndef __WINDOWS__
  26. #include <Windows.h>
  27. /*    #include <Events.h>                                            */
  28. /*        #include <OSUtils.h>                                    */
  29. /*    #include <Controls.h>                                        */
  30. /*        #include <Menus.h>                                        */
  31. #endif
  32.  
  33. enum  {
  34.     pmCourteous                    = 0,                            /*Record use of color on each device touched.*/
  35.     pmTolerant                    = 0x0002,                        /*render ciRGB if ciTolerance is exceeded by best match.*/
  36.     pmAnimated                    = 0x0004,                        /*reserve an index on each device touched and render ciRGB.*/
  37.     pmExplicit                    = 0x0008,                        /*no reserve, no render, no record; stuff index into port.*/
  38.     pmWhite                        = 0x0010,
  39.     pmBlack                        = 0x0020,
  40.     pmInhibitG2                    = 0x0100,
  41.     pmInhibitC2                    = 0x0200,
  42.     pmInhibitG4                    = 0x0400,
  43.     pmInhibitC4                    = 0x0800,
  44.     pmInhibitG8                    = 0x1000,
  45.     pmInhibitC8                    = 0x2000,
  46. /* NSetPalette Update Constants */
  47.     pmNoUpdates                    = 0x8000,                        /*no updates*/
  48.     pmBkUpdates                    = 0xA000,                        /*background updates only*/
  49.     pmFgUpdates                    = 0xC000,                        /*foreground updates only*/
  50.     pmAllUpdates                = 0xE000                        /*all updates*/
  51. };
  52.  
  53. #if defined(powerc) || defined (__powerc)
  54. #pragma options align=mac68k
  55. #endif
  56. struct ColorInfo {
  57.     RGBColor                    ciRGB;                            /*true RGB values*/
  58.     short                        ciUsage;                        /*color usage*/
  59.     short                        ciTolerance;                    /*tolerance value*/
  60.     short                        ciDataFields[3];                /*private fields*/
  61. };
  62. #if defined(powerc) || defined(__powerc)
  63. #pragma options align=reset
  64. #endif
  65.  
  66. typedef struct ColorInfo ColorInfo;
  67.  
  68. #if defined(powerc) || defined (__powerc)
  69. #pragma options align=mac68k
  70. #endif
  71. struct Palette {
  72.     short                        pmEntries;                        /*entries in pmTable*/
  73.     short                        pmDataFields[7];                /*private fields*/
  74.     ColorInfo                    pmInfo[1];
  75. };
  76. #if defined(powerc) || defined(__powerc)
  77. #pragma options align=reset
  78. #endif
  79.  
  80. typedef struct Palette Palette;
  81.  
  82. typedef Palette *PalettePtr, **PaletteHandle;
  83.  
  84. #ifdef __cplusplus
  85. extern "C" {
  86. #endif
  87.  
  88. extern pascal void InitPalettes(void)
  89.  ONEWORDINLINE(0xAA90);
  90. extern pascal PaletteHandle NewPalette(short entries, CTabHandle srcColors, short srcUsage, short srcTolerance)
  91.  ONEWORDINLINE(0xAA91);
  92. extern pascal PaletteHandle GetNewPalette(short PaletteID)
  93.  ONEWORDINLINE(0xAA92);
  94. extern pascal void DisposePalette(PaletteHandle srcPalette)
  95.  ONEWORDINLINE(0xAA93);
  96. extern pascal void ActivatePalette(WindowPtr srcWindow)
  97.  ONEWORDINLINE(0xAA94);
  98. extern pascal void SetPalette(WindowPtr dstWindow, PaletteHandle srcPalette, Boolean cUpdates)
  99.  ONEWORDINLINE(0xAA95);
  100. extern pascal void NSetPalette(WindowPtr dstWindow, PaletteHandle srcPalette, short nCUpdates)
  101.  ONEWORDINLINE(0xAA95);
  102. extern pascal PaletteHandle GetPalette(WindowPtr srcWindow)
  103.  ONEWORDINLINE(0xAA96);
  104. extern pascal void CopyPalette(PaletteHandle srcPalette, PaletteHandle dstPalette, short srcEntry, short dstEntry, short dstLength)
  105.  ONEWORDINLINE(0xAAA1);
  106. extern pascal void PmForeColor(short dstEntry)
  107.  ONEWORDINLINE(0xAA97);
  108. extern pascal void PmBackColor(short dstEntry)
  109.  ONEWORDINLINE(0xAA98);
  110. extern pascal void AnimateEntry(WindowPtr dstWindow, short dstEntry, const RGBColor *srcRGB)
  111.  ONEWORDINLINE(0xAA99);
  112. extern pascal void AnimatePalette(WindowPtr dstWindow, CTabHandle srcCTab, short srcIndex, short dstEntry, short dstLength)
  113.  ONEWORDINLINE(0xAA9A);
  114. extern pascal void GetEntryColor(PaletteHandle srcPalette, short srcEntry, RGBColor *dstRGB)
  115.  ONEWORDINLINE(0xAA9B);
  116. extern pascal void SetEntryColor(PaletteHandle dstPalette, short dstEntry, const RGBColor *srcRGB)
  117.  ONEWORDINLINE(0xAA9C);
  118. extern pascal void GetEntryUsage(PaletteHandle srcPalette, short srcEntry, short *dstUsage, short *dstTolerance)
  119.  ONEWORDINLINE(0xAA9D);
  120. extern pascal void SetEntryUsage(PaletteHandle dstPalette, short dstEntry, short srcUsage, short srcTolerance)
  121.  ONEWORDINLINE(0xAA9E);
  122. extern pascal void CTab2Palette(CTabHandle srcCTab, PaletteHandle dstPalette, short srcUsage, short srcTolerance)
  123.  ONEWORDINLINE(0xAA9F);
  124. extern pascal void Palette2CTab(PaletteHandle srcPalette, CTabHandle dstCTab)
  125.  ONEWORDINLINE(0xAAA0);
  126. extern pascal long Entry2Index(short entry)
  127.  TWOWORDINLINE(0x7000, 0xAAA2);
  128. extern pascal void RestoreDeviceClut(GDHandle gd)
  129.  TWOWORDINLINE(0x7002, 0xAAA2);
  130. extern pascal void ResizePalette(PaletteHandle p, short size)
  131.  TWOWORDINLINE(0x7003, 0xAAA2);
  132. extern pascal void SaveFore(ColorSpec *c)
  133.  THREEWORDINLINE(0x303C, 0x040D, 0xAAA2);
  134. extern pascal void SaveBack(ColorSpec *c)
  135.  THREEWORDINLINE(0x303C, 0x040E, 0xAAA2);
  136. extern pascal void RestoreFore(const ColorSpec *c)
  137.  THREEWORDINLINE(0x303C, 0x040F, 0xAAA2);
  138. extern pascal void RestoreBack(const ColorSpec *c)
  139.  THREEWORDINLINE(0x303C, 0x0410, 0xAAA2);
  140. extern pascal OSErr SetDepth(GDHandle gd, short depth, short whichFlags, short flags)
  141.  THREEWORDINLINE(0x303C, 0x0A13, 0xAAA2);
  142. extern pascal short HasDepth(GDHandle gd, short depth, short whichFlags, short flags)
  143.  THREEWORDINLINE(0x303C, 0x0A14, 0xAAA2);
  144. extern pascal short PMgrVersion(void)
  145.  TWOWORDINLINE(0x7015, 0xAAA2);
  146. extern pascal void SetPaletteUpdates(PaletteHandle p, short updates)
  147.  THREEWORDINLINE(0x303C, 0x0616, 0xAAA2);
  148. extern pascal short GetPaletteUpdates(PaletteHandle p)
  149.  THREEWORDINLINE(0x303C, 0x0417, 0xAAA2);
  150. extern pascal Boolean GetGray(GDHandle device, const RGBColor *backGround, RGBColor *foreGround)
  151.  THREEWORDINLINE(0x303C, 0x0C19, 0xAAA2);
  152. #ifdef __cplusplus
  153. }
  154. #endif
  155.  
  156. #endif
  157.  
  158.